window.views = window.views || {}
window.views.pics = window.views.pics || {}



window.views.pics.PicsModel = function(data, root){
	var self = this;
	self.root = root;

	data = _.map(data, function(it){
		it.copy_src ="http://" + window.location.host + window.views.pics.base_url + '/views/imgsrc/' + it.src;
		it.copy_src_up ="http://" + window.location.host + window.views.pics.base_url + '../views/imgsrc/' + it.src;
		it.src_up = '../views/imgsrc/' + it.src;
		it.src = 'views/imgsrc/' + it.src;
		it.click = function(){
			self.root.filename(it.copy_src);
		}
		return it;
	});
	self.pics = ko.observable(data);
	self.select = function(e,el){
		$(el.target).select();
	}
}


/*

function ViewModel(){
	var self = this;
	self.views = {
		auth: new window.views.auth(self),
		
	};
	self.filename = ko.observable();
}


$(function(){
	ko.applyBindings(new ViewModel());
});
*/